package com.ssy.lingxi.logistics.api.fallback;

import com.ssy.lingxi.common.response.ResponseCode;
import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.logistics.api.dto.request.OrderFreightRequest;
import com.ssy.lingxi.logistics.api.dto.request.OrderSeparateFreightListRequest;
import com.ssy.lingxi.logistics.api.dto.request.TransferOrderFreightRequest;
import com.ssy.lingxi.logistics.api.dto.response.FreightResponse;
import com.ssy.lingxi.logistics.api.dto.response.OrderSeparateFreightListResponse;
import com.ssy.lingxi.logistics.api.feign.FreightRemoteControllerFeign;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;
import java.util.List;

@Component
public class FreightRemoteControllerFeignFallback implements FreightRemoteControllerFeign {

    @Override
    public Wrapper<BigDecimal> calFreightPrice(OrderFreightRequest request) {
        return Wrapper.fail(ResponseCode.SERVICE_LOGISTICS_ERROR);
    }

    @Override
    public Wrapper<List<FreightResponse>> batchCalFreightPrice(List<TransferOrderFreightRequest> requestList) {
        return Wrapper.fail(ResponseCode.SERVICE_LOGISTICS_ERROR);
    }

    /**
     * 批量查询运费（拆单）
     *
     * @param requests 拆单后的商品信息列表
     * @return 查询结果
     */
    @Override
    public Wrapper<List<OrderSeparateFreightListResponse>> findSeparateOrderFreight(List<OrderSeparateFreightListRequest> requests) {
        return Wrapper.fail(ResponseCode.SERVICE_LOGISTICS_ERROR);
    }

//    @Override
//    public Wrapper<Map<OrderSeparateFreightRequest, BigDecimal>> findSeparateOrderFreight(Map<OrderSeparateFreightRequest, List<OrderSeparateProductFreightDetail>> products) {
//        return Wrapper.fail(ResponseCode.SERVICE_LOGISTICS_ERROR);
//    }
}
